package com.gagakuai.utils.concurrent;


import java.util.Iterator;
import java.util.List;
import java.util.concurrent.*;

/*
 * @description: 事件循环器线程池
 * @author: houhong
 * @create: 2024-03-19 00:11
 */
public interface EventExecutorGroup extends ScheduledExecutorService, Iterable<EventExecutor>{

    boolean isShuttingDown();

    Future<?> shutdownGracefully();

    Future<?> shutdownGracefully(long quietPeriod, long timeout, TimeUnit unit);


    Future<?> terminationFuture();


    @Override
    @Deprecated
    void shutdown();


    @Override
    @Deprecated
    List<Runnable> shutdownNow();


    EventExecutor next();

    @Override
    Iterator<EventExecutor> iterator();

    @Override
    Future<?> submit(Runnable task);

    @Override
    <T> Future<T> submit(Runnable task, T result);

    @Override
    <T> Future<T> submit(Callable<T> task);

    @Override
    ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit);

    @Override
    <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit);

    @Override
    ScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit);

    @Override
    ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit);
}
